import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/Table';
import { rules } from '@pkg/utils';
import { render } from '@apps/antd-admin/src/hooks/render/renderUtils';
import { RenderType } from '@pkg/setting';
import { Api } from './project.api';
export const columns: BasicColumn[] = [

  {
    title: '模块名称',
    dataIndex: 'moduleName',
    width: 130,
  },
  {
    title: '模块图',
    dataIndex: 'moduleIcon',
    width: 60,
    customRender: render.renderImage,
  },
  {
    title: '详情图',
    dataIndex: 'coverImage',
    width: 60,
    customRender: render.renderImage,
  },
  {
    title: '启用状态',
    dataIndex: 'state',
    width: 120,
    align: 'center',
    rowKey: 'moduleId',
    renderApi: Api.setState,
    actionAuth:'ACTION_module_state',
    customRender: render.renderSwitch,
  },
  {
    title: '上线状态',
    dataIndex: 'onLine',
    width: 120,
    align: 'center',
    rowKey: 'moduleId',
    renderApi: Api.setOnline,
    actionAuth:'ACTION_module_onLine',
    customRender: render.renderSwitch,
  },
  {
    title: '创建日期',
    dataIndex: 'createTime',
    width: 80,
    sorter: {
      multiple: 2,
    },
  },
];

export const searchFormSchema: FormSchema[] = [


];

export const formSchema: FormSchema[] = [
  {
    label: '模块名称',
    field: 'moduleName',
    component: 'Input',
  },
  {
    label: '模块图',
    field: 'moduleIcon',
    component: 'ImageUpload',
    itemProps:{
      extra:"尺寸秒查547*636,惠查精查543*298",
    },
  },
  {
    label: '详情图',
    field: 'coverImage',
    component: 'ImageUpload',
    itemProps:{
      extra:"尺寸1200*616",
    },
  },
];
